<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        var name = "aaa\\.";
        var regname = /^\w{3}\\\.$/;
        alert(regname.test(name));
    </script>
</head>
<body>

</body>
</html>